Skip to content

Bigz/maker orders#3

Open
crispheaney wants to merge 3 commits intomasterfrom
bigz/maker-orders
Open

Bigz/maker orders#3
crispheaney wants to merge 3 commits intomasterfrom
bigz/maker-orders

Conversation

@crispheaney
Copy link
Member

No description provided.

}
const markets = clearingHouse.getMarketsAccount();

const markets_with_position = clearingHouseUser
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be camelCase


// convient check/message for too many positions/orders across markets
if (
markets_with_position.length >= 5 &&
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will never be greater than 5, can probably make it marketsWithPosition.length === 5


const markets_with_position = clearingHouseUser
.getUserPositionsAccount()
.positions.map((position) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should filter out the markets where base asset amount is zero. Right now this will always say it's five positions?

// convient check/message for too many positions/orders across markets
if (
markets_with_position.length >= 5 &&
!markets_with_position.includes(orderMarket)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the order doesnt exist in marketsWithPosition, should probably add it so we can keep track of number of positions after orders are canceled and then replaced

});

// cancel all open orders before placing new ones
// if (userOrdersAccountExists && numOpenOrders > 0) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should just assumed userOrdersAccountExists exists

0,
postOnly,
ZERO,
false //ioc
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to upgrade the package.json to at least use 0.1.29 for sdk

const clearingHousePublicKey = new PublicKey(
sdkConfig.CLEARING_HOUSE_PROGRAM_ID
);
const clearingHouse = Admin.from(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldnt be using Admin. can we use getClearingHouse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant